//
//  User.m
//  AI
//
//  Created by zjhc on 2018/1/11.
//  Copyright © 2018年 zjhc. All rights reserved.
//

#import "User.h"

@implementation User

-(void)verifyUser {
    
    if (!_userName) {
        _userName = @"";
    }

}

+(NSMutableDictionary *)Users:(User *)user {
    
    [user verifyUser];
    
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    [dict setObject:user.userName forKey:@"userName"];
    [dict setObject:user.password forKey:@"password"];
    return dict;
}

+(User *)getUserByDic:(NSDictionary *)dict {
    NSString *jsonStr = [HXNSStringUtil getJsonStringFromDicOrArray:dict];
    User *user = [[User alloc]initWithString:jsonStr error:nil];
    return  user;
}

@end
